package com.fbee.smartcommunities.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fbee.smartcommunities.core.Base;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import lombok.*;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author 汪佳泉
 * @since 2024-08-16
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class User extends Base {

    private static final long serialVersionUID = 1L;

    public User(String name) {
        this.name = name;
    }

    /**
     * 密码
     */
    @JsonIgnore // 不返回给前端
    private String password;

    /**
     * 昵称
     */
    private String nickName;

    /**
     * 真实姓名
     */
    private String name;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 手机号
     */
    private String phone;

    /**
     * 头像
     */
    private String icon;

    /**
     * 角色
     */
    private Integer roleId;

    /**
     * 地址
     */
    private String address;

    /**
     * 生日
     */
    private LocalDate birthday;

    /**
     * 账户余额
     */
    private BigDecimal account;

    /**
     * 用户状态
     */
    private Integer state;

    public User(String password, String nickName, String name, String email, String phone, String icon, Integer roleId, String address, LocalDate birthday, Integer state) {
        this.password = password;
        this.nickName = nickName;
        this.name = name;
        this.email = email;
        this.phone = phone;
        this.icon = icon;
        this.roleId = roleId;
        this.address = address;
        this.birthday = birthday;
        this.state = state;
    }

    public User(String password, String nickName, String name, String email, String phone, Integer roleId, String address, LocalDate birthday, Integer state) {
        this.password = password;
        this.nickName = nickName;
        this.name = name;
        this.email = email;
        this.phone = phone;
        this.roleId = roleId;
        this.address = address;
        this.birthday = birthday;
        this.state = state;
    }

    public User(String email, String password, Integer roleId,Integer state,String nickName) {
        this.email = email;
        this.password = password;
        this.roleId = roleId;
        this.state = state;
        this.nickName = nickName;
    }
}
